<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>${userTypeDictItem.itemName}管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnExport").click(function () {
                top.$.jBox.confirm("确认要导出用户数据吗？", "系统提示", function (v, h, f) {
                    if (v == "ok") {
                        $("#searchForm").attr("action", "${ctx}/sys/sysUser/export");
                        $("#searchForm").submit();
                    }
                }, {buttonsFocus: 1});
                top.$('.jbox-body .jbox-icon').css('top', '55px');
            });
        });

        function page(n, s) {
            if (n) $("#pageCurrent").val(n);
            if (s) $("#pageSize").val(s);
            $("#searchForm").attr("action", "${ctx}/sys/sysUser/busiList?userType=${userTypeDictItem.itemCode}");
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/sys/sysUser/busiList?userType=${userTypeDictItem.itemCode}">${userTypeDictItem.itemName}列表</a></li>
    <shiro:hasPermission name="sys:sysUser:edit">
        <li><a href="${ctx}/sys/sysUser/busiForm?userType=${userTypeDictItem.itemCode}">${userTypeDictItem.itemName}添加</a></li>
    </shiro:hasPermission>
</ul>
<form:form id="searchForm" modelAttribute="sysUser" action="${ctx}/sys/sysUser/busiList?userType=${userTypeDictItem.itemCode}" method="post" class="breadcrumb form-search ">
    <input id="pageCurrent" name="pageCurrent" type="hidden" value="${page.current}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.size}"/>
    <ul class="ul-form">
        <li>
            <label>姓&nbsp;&nbsp;&nbsp;名：</label>
            <form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
        </li>
        <li>
            <label>登录名：</label>
            <form:input path="loginName" htmlEscape="false" maxlength="50" class="input-medium"/>
        </li>
        <li>
            <label>手机号：</label>
            <form:input path="mobile" htmlEscape="false" maxlength="50" class="input-medium"/>
        </li>
        <li class="btns">
            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page();"/>
        <li class="clearfix"></li>
    </ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>姓名</th>
        <th>登录名</th>
        <th>手机号</th>
        <th>所属机构</th>
        <th>状态</th>
        <shiro:hasPermission name="sys:sysUser:edit">
            <th>操作</th>
        </shiro:hasPermission></tr>
    </thead>
    <tbody>
    <c:forEach items="${page.records}" var="user">
        <tr>
            <td>${user.name}</td>
            <td>${user.loginName}</td>
            <td>${user.mobile}</td>
            <td>${user.office.name}</td>
            <td>${fns:getDataDictValue( 'del_flag',user.delFlag)}</td>
            <shiro:hasPermission name="sys:sysUser:edit">
                <td>
                    <a href="${ctx}/sys/sysUser/busiForm?userType=${userTypeDictItem.itemCode}&id=${user.id}">修改</a>
                    <a href="${ctx}/sys/sysUser/busiDelete?userType=${userTypeDictItem.itemCode}&id=${user.id}"
                       onclick="return confirmx('确认要删除该${userTypeDictItem.itemName}吗？', this.href)">删除</a>
                </td>
            </shiro:hasPermission>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>